<template>
  <div>
    <!-- 头部块 -->
    <div class="top">
      <div class="top__title">
        <slot name="title">
          <div>{{ title }}</div>
        </slot>
      </div>
      <div class="top__subTitle">
        <slot name="subTitle">
          <div>{{ subTitle }}</div>
        </slot>
      </div>
    </div>
    <!-- 内容块 -->
    <div class="p-4">
      <slot></slot>
    </div>
  </div>
</template>

<script lang="ts" setup>
defineProps(["title", "subTitle"]);
</script>

<style lang="scss" scoped>
@mixin block($block) {
  .#{$block} {
    @content;
  }
}

@mixin element($element) {
  &__#{$element} {
    @content;
  }
}

@mixin modifier($modifier) {
  &--#{$modifier} {
    @content;
  }
}

@include block(top) {
  width: 100%;

  box-shadow: 0px 5px 4px rgba($color: #000000, $alpha: 0.05);
  @apply flex
    justify-between;
  // @apply;
  @include element(title) {
    width: fit-content;
    @apply text-xl font-bold p-4;
  }

  @include element(subTitle) {
    @apply text-sm font-bold p-4 flex justify-center items-center opacity-60;
  }

  @include element(content) {
    width: 100%;
  }
}
</style>
